import request from '@/utils/request'
import {isEmpty} from '@/api/system/dict/data';


// 分页查询列表
export function listLimitOf${entity.functionName}(params,page,limit) {
    return request({
        url: '/${url}/list/limit/'+page+'/'+limit,
        method: 'post',
        refreshTip:false,
        params
    })
}

// 选择列表
export function selectListOf${entity.functionName}(params) {
    return request({
        url: '/${url}/list/select',
        method: 'post',
        params
    })
}

// 选择列表
export function displayListOf${entity.functionName}(id) {
    let obj = new Object();
    obj.${idFiled}=id;
    return request({
        url: '/${url}/display',
        method: 'post',
        tip:1,
        data:obj
    })
}

// 导出报表列表
export function exportReportList(params) {
    return request({
        url: '/${url}/export',
        method: 'get',
        params
    })
}

//查询列表详情
export function viewOf${entity.functionName}(id) {
    return request({
        url: '/${url}/view/'+id,
        method: 'get'
    })
}

// 添加数据
export function addOf${entity.functionName}(params) {
        return request({
        url: '/${url}/add',
        method: 'post',
        params
    })
}

//修改数据
export function updateOf${entity.functionName}(params) {
    return request({
        url: "/${url}/update",
        method: "post",
        params
    })
}


    //修改状态
export function updateStatusOf${entity.functionName}(params) {
    return request({
        url: "/${url}/update/status",
        method: "post",
        params
    })
}

    //删除数据
export function deleteOf${entity.functionName}(id) {
    return request({
        url: "/${url}/del/"+id,
        method: "get"
    })
}


export function cleanAttVal${entity.functionName}(obj){
<#list filedList as filed>
    if(isEmpty(obj.value.${filed.name})){
        obj.value.${filed.name} = null;
    }
</#list>
}